package com.hui.server;

import com.hui.server.entity.Department;
import com.hui.server.mapper.AdminMapper;
import com.hui.server.mapper.DepartmentMapper;
import com.hui.server.mapper.MenuMapper;
import com.hui.server.mapper.MenuRoleMapper;
import com.hui.server.util.JoblevelEnum;
import io.lettuce.core.output.ScoredValueScanOutput;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
import org.springframework.scheduling.annotation.Scheduled;
import springfox.documentation.annotations.ApiIgnore;

import java.time.LocalDateTime;

/**
 * @BelongsProject: yeb
 * @BelongsPackage: com.hui.server
 * @Author: HUI
 * @CreateTime: 2022-04-08 10:01
 * @Description:
 */

@SpringBootTest
public class testLoginInterfaceAfter {

    @Autowired
    MenuMapper mapper;

    @Autowired
    MenuRoleMapper menuRoleMapper;

    @Autowired
    DepartmentMapper departmentMapper;

    @Autowired
    AdminMapper adminMapper;

    @Test
    void test() {
        String valueOfs = JoblevelEnum.valueOfs("vice_senior");
        System.out.println(valueOfs);


    }

    @Test
    void testGetAllMenus(){
        menuRoleMapper.getAll().forEach(System.err::println);

    }


    @Test
    void testDepMapper(){
//        departmentMapper.getAllDepartment(-1).forEach(System.err::println);

        Department department = new Department().setName("java测试").setParentId(13);
        departmentMapper.addDep(department);
        System.err.println("最后成功的结果："+department.getResult());

    }

    @Test
    void testDeleteDep(){
        Department department = new Department().setId(27);
        departmentMapper.deleteDep(department);
        System.err.println("最后成功的结果："+department.getResult());
    }


    @Test
    void testAdminLikeQuery(){
        adminMapper.getAllAdminsByFuzzyQuery(1,"淑").forEach(System.err::println);
    }


    @Scheduled(cron = "0/10 * * * * ?")
    void test2(){

    }

}
